package com.qcby.controller;

import com.qcby.entity.Admin;
import com.qcby.entity.Result;
import com.qcby.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/admin")
@RestController
public class AdminController {
    @Autowired
    private AdminService adminService;
    //    登录接口
    @PostMapping("/login")
    public Result login(Admin admin){
        return adminService.login(admin);
    }
    @PostMapping("/getinformationbyname")
    public Result GetInformation(String name){
        Admin admin = adminService.GetInformation(name);
        return Result.success(admin);
    }
}
